Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Startup and shutdown procedures
Startup and Shutdown procedures encapsulate logic that executes during the startup and shutdown of an AppServer. In effect, the logic in these procedures executes in each AppServer agent as it starts up and shuts down. Functionality that might go in a Startup or Shutdown procedure includes connecting or disconnecting databases, loading or storing the contents of temp-tables, and instantiating or deleting certain local persistent procedures.
Startup procedure
A Startup procedure executes as an AppServer agent starts up. You can specify the name of an AppServer Startup procedure using the Progress Explorer GUI or by setting the
srvrStartupProcproperty in the AppServer properties file (ubroker.properties).The Startup procedure takes a character string as an input parameter, for example:
You can set the value for this parameter in the properties file using the
srvrStartupProcParamproperty, and you can set it to any arbitrary value. If you do not specify a value for this property, the parameter is set to the Unknown value (?) when the AppServer agent executes the Startup procedure.The Startup procedure is automatically executed as a persistent procedure within each AppServer agent when the AppServer agent first starts. The persistent procedure is automatically deleted just before the agent terminates. If you do not need the context established by the Startup procedure, you can delete the persistent procedure within an AppServer agent context by executing the
DELETEPROCEDURE(orDELETEOBJECT) statement using the appropriate procedure handle.If the Startup procedure completes with no error, the AppServer starts up successfully. If the Startup procedure completes with an error return value (
RETURNERRORstatement), AppServer startup fails and the AppServer agent is terminated.Shutdown procedure
A Shutdown procedure executes just before the AppServer agent is shut down. A Shutdown procedure takes no parameters. You can specify the name of an AppServer Shutdown procedure using the Progress Explorer GUI or by setting the
srvrShutdownProcproperty in the AppServer properties file (ubroker.properties).Unlike the Startup procedure, the Shutdown procedure is run as a non-persistent procedure, and any errors propagated by the Shutdown procedure are simply ignored. The AppServer agent terminates immediately after the Shutdown procedure executes.
Usage requirements
You can specify Startup and Shutdown procedures for a state-aware or stateless AppServer. You cannot specify Startup and Shutdown procedures for a state-reset AppServer.
Note that both the Startup and Shutdown procedures are optional. There is no requirement to specify either or both of them. Additionally, the content of these procedures is completely application specific, and the AppServer architecture places no constraints on it. Any Progress 4GL logic that is valid within an AppServer agent is valid for these procedures.
Note: In Progress Version 8, you used the Connect procedure to program all startup activities on an AppServer agent. With the introduction of reusable and stateless servers much of the logic that you might have put into the Connect procedure for the Version 8 AppServer is now more appropriate for the Startup procedure. Similarly, much of the logic in a Version 8 Disconnect procedure might be more appropriate for the Shutdown procedure.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |